package com.sky.sky_common.result;

import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class Result implements Serializable{
    private Integer code; //编码：1成功，0和其它数字为失败
    private String msg; //提示信息
    private Object data; //返回数据
    public static Result success(){
        return new Result(1,"success",null);
    }
    public static Result success(Object data){
        return new Result(1,"success",data);
    }
    public static Result error(){
        return new Result(0,"error",null);
    }
    public static Result error(String msg){
        return new Result(0,msg,null);
    }
}
